/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sn.gandal.mobile.kalpet.persistence;

import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @version V 1.0 01/03/2010
 * @author SOWDIOMYERO
 */
@Entity
@Table(name = "codes_operateurs", catalog = "kmobile", schema = "")
@NamedQueries({
    @NamedQuery(name = "CodesOperateurs.findAll", query = "SELECT c FROM CodesOperateurs c"),
    @NamedQuery(name = "CodesOperateurs.findById", query = "SELECT c FROM CodesOperateurs c WHERE c.id = :id"),
    @NamedQuery(name = "CodesOperateurs.findByCodeOperateur", query = "SELECT c FROM CodesOperateurs c WHERE c.codeOperateur = :codeOperateur"),
    @NamedQuery(name = "CodesOperateurs.findByLibelle", query = "SELECT c FROM CodesOperateurs c WHERE c.libelle = :libelle"),
    @NamedQuery(name = "CodesOperateurs.findByDateCreated", query = "SELECT c FROM CodesOperateurs c WHERE c.dateCreated = :dateCreated")})
public class CodesOperateurs implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id", nullable = false)
    private Integer id;
    @Basic(optional = false)
    @Column(name = "codeOperateur", nullable = false, length = 20)
    private String codeOperateur;
    @Basic(optional = false)
    @Column(name = "libelle", nullable = false, length = 50)
    private String libelle;
    @Basic(optional = false)
    @Column(name = "dateCreated", nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateCreated;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "codesOperateurs", fetch = FetchType.LAZY)
    private List<Cartes> cartesList;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "codesOperateurs", fetch = FetchType.LAZY)
    private List<CodeUtilisateur> codeUtilisateurList;

    public CodesOperateurs() {
    }

    public CodesOperateurs(Integer id) {
        this.id = id;
    }

    public CodesOperateurs(Integer id, String codeOperateur, String libelle, Date dateCreated) {
        this.id = id;
        this.codeOperateur = codeOperateur;
        this.libelle = libelle;
        this.dateCreated = dateCreated;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getCodeOperateur() {
        return codeOperateur;
    }

    public void setCodeOperateur(String codeOperateur) {
        this.codeOperateur = codeOperateur;
    }

    public String getLibelle() {
        return libelle;
    }

    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    public Date getDateCreated() {
        return dateCreated;
    }

    public void setDateCreated(Date dateCreated) {
        this.dateCreated = dateCreated;
    }

    public List<Cartes> getCartesList() {
        return cartesList;
    }

    public void setCartesList(List<Cartes> cartesList) {
        this.cartesList = cartesList;
    }

    public List<CodeUtilisateur> getCodeUtilisateurList() {
        return codeUtilisateurList;
    }

    public void setCodeUtilisateurList(List<CodeUtilisateur> codeUtilisateurList) {
        this.codeUtilisateurList = codeUtilisateurList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CodesOperateurs)) {
            return false;
        }
        CodesOperateurs other = (CodesOperateurs) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "sn.gandal.mobile.kalpet.persistence.CodesOperateurs[id=" + id + "]";
    }

}
